// Observer.h: interface for the Observer class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_OBSERVER_H__C4E75443_DB92_4122_A8E0_7C1F7A29C09E__INCLUDED_)
#define AFX_OBSERVER_H__C4E75443_DB92_4122_A8E0_7C1F7A29C09E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class Subject;

class Observer
{
public:
	virtual void Update(Subject * pSubject) = 0;

protected:
	Observer();
	virtual ~Observer();
};

class Subject
{
protected:
	Subject();
	virtual ~Subject();

public:
	virtual void Attach(Observer * pObserver);
	virtual void Detach(Observer * pObserver);
	virtual void Notify();

private:
	std::list<Observer *> m_Observers;
};

#endif // !defined(AFX_OBSERVER_H__C4E75443_DB92_4122_A8E0_7C1F7A29C09E__INCLUDED_)
